var _n73;
var cc__extends = __extends;
var cc__decorate = __decorate;
var cc__importDefault = __importDefault;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $1$zqcc_pageBase = require("zqcc_pageBase");
var s = cc__importDefault($1$zqcc_pageBase);
var $zqcc_OverallSystem = require("zqcc_OverallSystem");
var $1$ScrollViewExample = require("ScrollViewExample");
var l = cc__importDefault($1$ScrollViewExample);
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_rankingList = function (t) {
  function _ctor() {
    // 使用apply方法调用传入的函数t并绑定当前上下文
    const instance = null !== t && t.apply(this, arguments) || this;

    // 初始化属性
    instance.scrollView = null; // 滚动视图
    instance.UINode = null; // 角色UI节点
    instance.initSelectMode = 1; // 初始化选择模式
    instance.curSelectNode = null; // 当前选择节点
    instance.wodediqu = null; // 其他属性

    return instance; // 返回当前实例
  }
  cc__extends(_ctor, t);
  _ctor.prototype.start = function () {
    t.prototype.start.call(this);
    this.curSelectNode = this.UINode.children[0];
    this.wodepaiming();
  };
  _ctor.prototype.selectCurMode = function (t, e) {
    // 播放按钮声音
    $zqcc_OverallSystem.mgrs().soundMgr.playBtnSound();

    // 将传入的参数 e 转换为数字
    const selectedMode = Number(e);
    this.initSelectMode = selectedMode;

    // 如果当前选择节点存在，则更新其选择状态
    if (this.curSelectNode !== null) {
      this.renewTargetSelectState(this.curSelectNode, false);
    }

    // 更新当前选择节点为 t.currentTarget
    this.curSelectNode = t.currentTarget;

    // 更新新选择节点的状态
    this.renewTargetSelectState(t.currentTarget, true);

    // 刷新滚动视图组件
    this.scrollView.getComponent(l.default).renewShow();
  };
  _ctor.prototype.renewTargetSelectState = function (t, e) {
    // 获取名称为 "select" 的子节点
    const selectNode = t.getChildByName("select");

    // 如果子节点存在，则设置其状态为 e
    if (selectNode !== null) {
      selectNode.active = e;
    }
  };
  _ctor.prototype.wodepaiming = function () {
    // 获取用户的城市数据
    const cityData = $zqcc_OverallSystem.sers().userSrv.getUserData().city;

    if (cityData !== null && cityData !== "") {
      let title = "";
      const userData = $zqcc_OverallSystem.sers().userSrv.getUserData();

      // 根据用户的最大等级设置称号
      if (userData.maxLevel >= 8) {
        title = "·大师";
      }
      if (userData.maxLevel >= 11) {
        title = "·雀神";
      }

      // 更新地区信息
      this.wodediqu.string = `${cityData.cityName}${title} 地区排名:第${cityData.rank}名`;
    } else {
      // 如果没有选定地区，显示相应信息
      this.wodediqu.string = "未选地区";
    }
  };
  cc__decorate([ccp_property({
    type: cc.Node,
    displayName: "滑动视图节点"
  })], _ctor.prototype, "scrollView", undefined);
  cc__decorate([ccp_property({
    type: cc.Node,
    displayName: "UI节点"
  })], _ctor.prototype, "UINode", undefined);
  cc__decorate([ccp_property(cc.Label)], _ctor.prototype, "wodediqu", undefined);
  return cc__decorate([ccp_ccclass], _ctor);
}(s.default);
exports.default = def_rankingList;